
package client.skills;


import client.status.MonsterStatus;
import com.alibaba.druid.pool.DruidPooledConnection;
import com.fasterxml.jackson.databind.ObjectMapper;
import configs.Config;
import configs.ServerConfig;
import database.DatabaseConnection;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import provider.*;
import tools.JsonUtil;
import tools.Randomizer;
import tools.StringUtil;
import tools.Triple;
import tools.config.BmsSerUtil;

import java.awt.*;
import java.io.File;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalTime;
import java.util.*;
import java.util.List;




























 public class SkillFactory {
    /*  31 */   private static final ObjectMapper mapper = JsonUtil.getMapperInstance();
    /*  32 */   private static final Logger log = LogManager.getLogger(SkillFactory.class);
    /*  33 */   private static final MapleData delayData = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Character.wz")).getData("00002000.img");
    /*  34 */   private static final MapleData stringData = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/String.wz")).getData("Skill.img");
    /*  35 */   private static final MapleDataProvider datasource = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Skill.wz"));

    /*  37 */   private static final List<String> skillFiles = new ArrayList<>();
    /*  38 */   private static Map<Integer, Skill> skills = new HashMap<>();
    /*  39 */   private static Map<Integer, CraftingEntry> craftings = new HashMap<>();
    /*  40 */   private static  List<Integer> finalAttackSkills = new LinkedList<>();
    /*  41 */   private static Map<Integer, String> skillNames = new HashMap<>();
    /*  42 */   private static final Map<String, Integer> delays = new HashMap<>();
    /*  43 */   private static Map<Integer, SummonSkillEntry> summonSkillInformation = new HashMap<>();
    /*  44 */   private static Map<Integer, FamiliarEntry> familiarInformation = new HashMap<>();
    /*  45 */   private static final Map<Integer, List<Integer>> skillByJobs = new HashMap<>();
    /*  46 */   private static final Map<Integer, Integer> memorySkills = new HashMap<>();



    public static void loadDelays() {
        /*  49 */
        int del = 0;

        try {
            /*  51 */
            for (MapleData delay : delayData) {
                /*  52 */
                if (!delay.getName().equals("info")) {
                    /*  53 */
                    delays.put(delay.getName(), Integer.valueOf(del));
                    /*  54 */
                    del++;

                }

            }
            /*  57 */
        } catch (Exception e) {
            /*  58 */
            log.error("加载技能冷却时间出错", e);

        }

    }


    public static void loadSkillData() {
        /* 235 */
        MapleDataDirectoryEntry root = datasource.getRoot();

            for (MapleDataFileEntry topDir : root.getFiles()) {
                /* 239 */
                if (topDir.getName().length() <= 10) {
                    /* 240 */
                    for (MapleData data : datasource.getData(topDir.getName())) {
                        /* 241 */
                        if (data.getName().equals("skill"))
                            /* 242 */ for (MapleData data2 : data) {
                            /* 243 */
                            if (data2 != null) {
                                /* 244 */
                                int skillid = Integer.parseInt(data2.getName());
                                /* 245 */
                                Skill skil = Skill.loadFromData(skillid, data2, delayData);
                                /* 246 */
                                skills.put(Integer.valueOf(skillid), skil);
                                /* 247 */
                                skillNames.put(Integer.valueOf(skillid), getName(skillid, stringData));
                                /* 248 */
                                List<Integer> job = skillByJobs.computeIfAbsent(Integer.valueOf(skillid / 10000), k -> new ArrayList());
                                /* 249 */
                                job.add(Integer.valueOf(skillid));

                                /* 251 */
                                MapleData summon_data = data2.getChildByPath("summon/attack1/info");
                                /* 252 */
                                if (data2.getChildByPath("summon/attack2/info") != null && skillid != 152101008 && skillid != 152101000) {
                                    /* 253 */
                                    summon_data = data2.getChildByPath("summon/attack2/info");

                                }
                                /* 255 */
                                if (summon_data != null) {
                                    /* 256 */
                                    SummonSkillEntry sse = new SummonSkillEntry();
                                    /* 257 */
                                    sse.type = (byte) MapleDataTool.getInt("type", summon_data, 0);
                                    /* 258 */
                                    sse.mobCount = (byte) MapleDataTool.getInt("mobCount", summon_data, 1);
                                    /* 259 */
                                    sse.attackCount = (byte) MapleDataTool.getInt("attackCount", summon_data, 1);
                                    /* 260 */
                                    sse.targetPlus = (byte) MapleDataTool.getInt("targetPlus", summon_data, 1);
                                    /* 261 */
                                    if (summon_data.getChildByPath("range/lt") != null) {
                                        /* 262 */
                                        MapleData ltd = summon_data.getChildByPath("range/lt");
                                        /* 263 */
                                        sse.lt = (Point) ltd.getData();
                                        /* 264 */
                                        sse.rb = (Point) summon_data.getChildByPath("range/rb").getData();

                                    } else {
                                        /* 266 */
                                        sse.lt = new Point(-100, -100);
                                        /* 267 */
                                        sse.rb = new Point(100, 100);

                                    }

                                    /* 270 */
                                    sse.delay = MapleDataTool.getInt("effectAfter", summon_data, 0) + MapleDataTool.getInt("attackAfter", summon_data, 0);

                                    /* 272 */
                                    for (MapleData effect : summon_data) {
                                        /* 273 */
                                        if (effect.getChildren().size() > 0) {
                                            /* 274 */
                                            for (MapleData effectEntry : effect) {
                                                /* 275 */
                                                sse.delay += MapleDataTool.getIntConvert("delay", effectEntry, 0);

                                            }

                                        }

                                    }
                                    /* 279 */
                                    for (MapleData effect : data2.getChildByPath("summon/attack1")) {
                                        /* 280 */
                                        sse.delay += MapleDataTool.getIntConvert("delay", effect, 0);

                                    }
                                    /* 282 */
                                    summonSkillInformation.put(Integer.valueOf(skillid), sse);

                                }

                            }

                        }

                    }
                    continue;

                }
                /* 288 */
                if (topDir.getName().startsWith("Familiar")) {
                    /* 289 */
                    for (MapleData data : datasource.getData(topDir.getName())) {
                        /* 290 */
                        FamiliarEntry skil = new FamiliarEntry();
                        /* 291 */
                        skil.prop = (byte) MapleDataTool.getInt("prop", data, 0);
                        /* 292 */
                        skil.time = (byte) MapleDataTool.getInt("time", data, 0);
                        /* 293 */
                        skil.attackCount = (byte) MapleDataTool.getInt("attackCount", data, 1);
                        /* 294 */
                        skil.targetCount = (byte) MapleDataTool.getInt("targetCount", data, 1);
                        /* 295 */
                        skil.speed = (byte) MapleDataTool.getInt("speed", data, 1);
                        /* 296 */
                        skil.knockback = (MapleDataTool.getInt("knockback", data, 0) > 0 || MapleDataTool.getInt("attract", data, 0) > 0);
                        /* 297 */
                        if (data.getChildByPath("lt") != null) {
                            /* 298 */
                            skil.lt = (Point) data.getChildByPath("lt").getData();
                            /* 299 */
                            skil.rb = (Point) data.getChildByPath("rb").getData();

                        }
                        /* 301 */
                        if (MapleDataTool.getInt("stun", data, 0) > 0) {
                            /* 302 */
                            skil.status.add(MonsterStatus.MOB_STAT_Stun);

                        }



                        /* 307 */
                        if (MapleDataTool.getInt("slow", data, 0) > 0) {
                            /* 308 */
                            skil.status.add(MonsterStatus.MOB_STAT_Speed);

                        }
                        /* 310 */
                        familiarInformation.put(Integer.valueOf(data.getName()), skil);

                    }
                    continue;
                    /* 312 */
                }
                if (topDir.getName().startsWith("Recipe")) {
                    /* 313 */
                    for (MapleData data : datasource.getData(topDir.getName())) {
                        /* 314 */
                        int skillid = Integer.parseInt(data.getName());
                        /* 315 */
                        CraftingEntry skil = new CraftingEntry(skillid, (byte) MapleDataTool.getInt("incFatigability", data, 0), (byte) MapleDataTool.getInt("reqSkillLevel", data, 0), (byte) MapleDataTool.getInt("incSkillProficiency", data, 0), (MapleDataTool.getInt("needOpenItem", data, 0) > 0), MapleDataTool.getInt("period", data, 0));
                        /* 316 */
                        for (MapleData d : data.getChildByPath("target")) {
                            /* 317 */
                            skil.targetItems.add(new Triple(Integer.valueOf(MapleDataTool.getInt("item", d, 0)), Integer.valueOf(MapleDataTool.getInt("count", d, 0)), Integer.valueOf(MapleDataTool.getInt("probWeight", d, 0))));

                        }
                        /* 319 */
                        for (MapleData d : data.getChildByPath("recipe")) {
                            /* 320 */
                            skil.reqItems.put(Integer.valueOf(MapleDataTool.getInt("item", d, 0)), Integer.valueOf(MapleDataTool.getInt("count", d, 0)));

                        }

                        /* 323 */
                        craftings.put(Integer.valueOf(skillid), skil);

                    }

                }

            }

        Collections.reverse(finalAttackSkills);

        }



    /* 328 */



    public static Skill reloadSkills(int skillid) {
        /* 332 */
        Skill[] skil = {null};

        try {
            /* 334 */
            if (skillFiles.isEmpty()) {
                /* 335 */
                for (MapleDataFileEntry mapleDataFileEntry : datasource.getRoot().getFiles()) {
                    /* 336 */
                    skillFiles.add(mapleDataFileEntry.getName());

                }

            }

            String filename;
            /* 340 */
            if (skillid >= 80000000 && skillid < 90000000) {
                /* 341 */
                filename = String.valueOf(skillid / 100);

            } else {
                /* 343 */
                filename = String.valueOf(skillid / 10000);

            }
            filename = filename + ".img";
            /* 346 */
            Optional.ofNullable(datasource.getData(filename)).ifPresent((data) -> {
                Optional.ofNullable(data.getChildByPath("skill")).ifPresent((skilldata) -> {
                    Optional.ofNullable(skilldata.getChildByPath(String.valueOf(skillid))).ifPresent((subdata) -> {
                        skil[0] = Skill.loadFromData(skillid, subdata, delayData);
                        skills.put(skillid, skil[0]);
                    });
                });
            });



        }
        /* 350 */ catch (Exception e) {
            /* 351 */
            System.out.println("技能数据读取错误，id " + skillid);
            /* 352 */
            e.printStackTrace();

        }
        /* 354 */
        return skil[0];

    }



    public static void loadMemorySkills() {
        /* 358 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 359 */         PreparedStatement ps = con.prepareStatement("SELECT * FROM memoryskills");
                /* 360 */         ResultSet rs = ps.executeQuery()) {
            /* 361 */
            while (rs.next()) {
                /* 362 */
                int skillId = rs.getInt("skillid");
                /* 363 */
                Skill skill = getSkill(skillId);



                /* 367 */
                if (memorySkills.containsKey(Integer.valueOf(skillId)) || skill == null || skill.getSkillByJobBook(skillId) == -1) {

                    continue;

                }
                /* 370 */
                memorySkills.put(Integer.valueOf(skillId), Integer.valueOf(skill.getSkillByJobBook(skillId)));

            }

        }
        /* 374 */ catch (SQLException e) {
            /* 375 */
            e.printStackTrace();

        }

    }



    public static String getSkillDefaultData(int skillid, String name) {
        /* 380 */
        MapleData skill = null;
        /* 381 */
        if (skillid == 80002247) {
            /* 382 */
            skill = datasource.getData(String.valueOf(skillid / 100) + ".img").getChildByPath("skill").getChildByPath(String.valueOf(skillid)).getChildByPath("common");

        } else {
            /* 384 */
            skill = datasource.getData(String.valueOf(skillid / 10000) + ".img").getChildByPath("skill").getChildByPath(String.valueOf(skillid)).getChildByPath("common");

        }

        /* 387 */
        if (skill != null) {
            /* 388 */
            for (MapleData data : skill) {
                /* 389 */
                if (data.getName().equals(name)) {
                    /* 390 */
                    return String.valueOf(data.getData());

                }

            }

        }
        /* 394 */
        return null;

    }



    public static int getIdFromSkillId(int skillId) {
        /* 398 */
        return ((Integer) memorySkills.getOrDefault(Integer.valueOf(skillId), Integer.valueOf(0))).intValue();

    }



    public static boolean isMemorySkill(int skillId) {
        /* 402 */
        return memorySkills.containsKey(Integer.valueOf(skillId));

    }



    public static List<Integer> getSkillsByJob(int jobId) {
        /* 406 */
        return skillByJobs.get(Integer.valueOf(jobId));

    }



    public static String getSkillName(int id) {
        /* 410 */
        if (skillNames.containsKey(Integer.valueOf(id))) {
            /* 411 */
            return skillNames.get(Integer.valueOf(id));

        }
        /* 413 */
        return "";

    }



    public static Integer getDelay(String id) {
        /* 417 */
        Delay delay = Delay.fromString(id);
        /* 418 */
        if (delay != null) {
            /* 419 */
            return Integer.valueOf(delay.i);

        }
        /* 421 */
        return delays.get(id);

    }



    private static String getName(int id, MapleData stringData) {
        /* 425 */
        String strId = Integer.toString(id);
        /* 426 */
        strId = StringUtil.getLeftPaddedStr(strId, '0', 7);
        /* 427 */
        MapleData skillroot = stringData.getChildByPath(strId);
        /* 428 */
        if (skillroot != null) {
            /* 429 */
            return MapleDataTool.getString(skillroot.getChildByPath("name"), "");

        }
        /* 431 */
        return "";

    }



    public static String getDesc(int id) {
        /* 435 */
        String strId = Integer.toString(id);
        /* 436 */
        strId = StringUtil.getLeftPaddedStr(strId, '0', 7);
        /* 437 */
        MapleData skillroot = stringData.getChildByPath(strId);
        /* 438 */
        if (skillroot != null) {
            /* 439 */
            return MapleDataTool.getString(skillroot.getChildByPath("desc"), "");

        }
        /* 441 */
        return "";

    }



    public static String getH(int id) {
        /* 445 */
        String strId = Integer.toString(id);
        /* 446 */
        strId = StringUtil.getLeftPaddedStr(strId, '0', 7);
        /* 447 */
        MapleData skillroot = stringData.getChildByPath(strId);
        /* 448 */
        if (skillroot != null) {
            /* 449 */
            return MapleDataTool.getString(skillroot.getChildByPath("h"), "");

        }
        /* 451 */
        return "";

    }



    public static SummonSkillEntry getSummonData(int skillid) {
        /* 455 */
        return summonSkillInformation.get(Integer.valueOf(skillid));

    }








    public static Map<Integer, String> getAllSkills() {
        /* 464 */
        return skillNames;

    }




















    public static Skill getSkill(int skillid) {
        /* 485 */
        if (!skills.isEmpty()) {
            /* 486 */
            if (skillid >= 92000000 && skillid < 100000000 && craftings.containsKey(Integer.valueOf(skillid))) {
                /* 487 */
                return craftings.get(Integer.valueOf(skillid));

            }
            /* 489 */
            return skills.get(Integer.valueOf(skillid));

        }
        /* 491 */
        return reloadSkills(skillid);

    }







    public static long getDefaultSExpiry(Skill skill) {
        /* 499 */
        if (skill == null) {
            /* 500 */
            return -1L;

        }
        /* 502 */
        return skill.isTimeLimited() ? (System.currentTimeMillis() + 2592000000L) : -1L;

    }



    public static CraftingEntry getCraft(int id) {
        /* 506 */
        return craftings.get(Integer.valueOf(id));

    }



    public static FamiliarEntry getFamiliar(int id) {
        /* 510 */
        return familiarInformation.get(Integer.valueOf(id));

    }






    public static boolean isBlockedSkill(int skillId) {
        /* 517 */
        return (skillId > 0 && ServerConfig.WORLD_BLOCKSKILLS.contains(String.valueOf(skillId)));

    }



    public static boolean addBlockedSkill(int skillId) {
        /* 521 */
        if (isBlockedSkill(skillId)) {
            /* 522 */
            return false;

        }
        /* 524 */
        ServerConfig.WORLD_BLOCKSKILLS += "," + skillId;
        /* 525 */
        Config.setProperty("world.blockskills", ServerConfig.WORLD_BLOCKSKILLS);
        /* 526 */
        return true;

    }






    public static int getTeachSkill(String name) {
        /* 533 */
        for (Map.Entry<Integer, String> entry : getAllSkills().entrySet()) {

            try {
                /* 535 */
                if (entry.getValue() != null && ((String) entry.getValue()).endsWith(name) && (
                        /* 536 */           (Integer) entry.getKey()).intValue() >= 80000000 && ((Integer) entry.getKey()).intValue() < 90000000) {
                    /* 537 */
                    return ((Integer) entry.getKey()).intValue();

                }

            }
            /* 540 */ catch (Exception e) {
                /* 541 */
                System.out.println(entry.getKey());

            }

        }
        /* 544 */
        return -1;

    }












    public static List<Integer> getFinalAttackSkills() {
        /* 557 */
        return finalAttackSkills;

    }



    public static boolean isFinalAttackSkills(Integer skillid) {
        /* 561 */
        return finalAttackSkills.contains(skillid);

    }


       public enum Delay
             {
        /* 566 */     walk1(0),
        /* 567 */     walk2(1),
        /* 568 */     stand1(2),
        /* 569 */     stand2(3),
        /* 570 */     alert(4),
        /* 571 */     swingO1(5),
        /* 572 */     swingO2(6),
        /* 573 */     swingO3(7),
        /* 574 */     swingOF(8),
        /* 575 */     swingT1(9),
        /* 576 */     swingT2(10),
        /* 577 */     swingT3(11),
        /* 578 */     swingTF(12),
        /* 579 */     swingP1(13),
        /* 580 */     swingP2(14),
        /* 581 */     swingPF(15),
        /* 582 */     stabO1(16),
        /* 583 */     stabO2(17),
        /* 584 */     stabOF(18),
        /* 585 */     stabT1(19),
        /* 586 */     stabT2(20),
        /* 587 */     stabTF(21),
        /* 588 */     swingD1(22),
        /* 589 */     swingD2(23),
        /* 590 */     stabD1(24),
        /* 591 */     swingDb1(25),
        /* 592 */     swingDb2(26),
        /* 593 */     swingC1(27),
        /* 594 */     swingC2(28),
        /* 595 */     rushBoom(28),
        /* 596 */     tripleBlow(25),
        /* 597 */     quadBlow(26),
        /* 598 */     deathBlow(27),
        /* 599 */     finishBlow(28),
        /* 600 */     finishAttack(29),
        /* 601 */     finishAttack_link(30),
        /* 602 */     finishAttack_link2(30),
        /* 603 */     shoot1(31),
        /* 604 */     shoot2(32),
        /* 605 */     shootF(33),
        /* 606 */     shootDb2(40),
        /* 607 */     shotC1(41),
        /* 608 */     dash(37),
        /* 609 */     dash2(38),
        /* 610 */     proneStab(41),
        /* 611 */     prone(42),
        /* 612 */     heal(43),
        /* 613 */     fly(44),
        /* 614 */     jump(45),
        /* 615 */     sit(46),
        /* 616 */     rope(47),
        /* 617 */     dead(48),
        /* 618 */     ladder(49),
        /* 619 */     rain(50),
        /* 620 */     alert2(52),
        /* 621 */     alert3(53),
        /* 622 */     alert4(54),
        /* 623 */     alert5(55),
        /* 624 */     alert6(56),
        /* 625 */     alert7(57),
        /* 626 */     ladder2(58),
        /* 627 */     rope2(59),
        /* 628 */     shoot6(60),
        /* 629 */     magic1(61),
        /* 630 */     magic2(62),
        /* 631 */     magic3(63),
        /* 632 */     magic5(64),
        /* 633 */     magic6(65),
        /* 634 */     explosion(65),
        /* 635 */     burster1(66),
        /* 636 */     burster2(67),
        /* 637 */     savage(68),
        /* 638 */     avenger(69),
        /* 639 */     assaulter(70),
        /* 640 */     prone2(71),
        /* 641 */     assassination(72),
        /* 642 */     assassinationS(73),
        /* 643 */     tornadoDash(76),
        /* 644 */     tornadoDashStop(76),
        /* 645 */     tornadoRush(76),
        /* 646 */     rush(77),
        /* 647 */     rush2(78),
        /* 648 */     brandish1(79),
        /* 649 */     brandish2(80),
        /* 650 */     braveSlash(81),
        /* 651 */     braveslash1(81),
        /* 652 */     braveslash2(81),
        /* 653 */     braveslash3(81),
        /* 654 */     braveslash4(81),
        /* 655 */     darkImpale(97),
        /* 656 */     sanctuary(82),
        /* 657 */     meteor(83),
        /* 658 */     paralyze(84),
        /* 659 */     blizzard(85),
        /* 660 */     genesis(86),
        /* 661 */     blast(88),
        /* 662 */     smokeshell(89),
        /* 663 */     showdown(90),
        /* 664 */     ninjastorm(91),
        /* 665 */     chainlightning(92),
        /* 666 */     holyshield(93),
        /* 667 */     resurrection(94),
        /* 668 */     somersault(95),
        /* 669 */     straight(96),
        /* 670 */     eburster(97),
        /* 671 */     backspin(98),
        /* 672 */     eorb(99),
        /* 673 */     screw(100),
        /* 674 */     doubleupper(101),
        /* 675 */     dragonstrike(102),
        /* 676 */     doublefire(103),
        /* 677 */     triplefire(104),
        /* 678 */     fake(105),
        /* 679 */     airstrike(106),
        /* 680 */     edrain(107),
        /* 681 */     octopus(108),
        /* 682 */     backstep(109),
        /* 683 */     shot(110),
        /* 684 */     rapidfire(110),
        /* 685 */     fireburner(112),
        /* 686 */     coolingeffect(113),
        /* 687 */     fist(114),
        /* 688 */     timeleap(115),
        /* 689 */     homing(117),
        /* 690 */     ghostwalk(118),
        /* 691 */     ghoststand(119),
        /* 692 */     ghostjump(120),
        /* 693 */     ghostproneStab(121),
        /* 694 */     ghostladder(122),
        /* 695 */     ghostrope(123),
        /* 696 */     ghostfly(124),
        /* 697 */     ghostsit(125),
        /* 698 */     cannon(126),
        /* 699 */     torpedo(127),
        /* 700 */     darksight(128),
        /* 701 */     bamboo(129),
        /* 702 */     pyramid(130),
        /* 703 */     wave(131),
        /* 704 */     blade(132),
        /* 705 */     souldriver(133),
        /* 706 */     firestrike(134),
        /* 707 */     flamegear(135),
        /* 708 */     stormbreak(136),
        /* 709 */     vampire(137),
        /* 710 */     swingT2PoleArm(139),
        /* 711 */     swingP1PoleArm(140),
        /* 712 */     swingP2PoleArm(141),
        /* 713 */     doubleSwing(142),
        /* 714 */     tripleSwing(143),
        /* 715 */     fullSwingDouble(144),
        /* 716 */     fullSwingTriple(145),
        /* 717 */     overSwingDouble(146),
        /* 718 */     overSwingTriple(147),
        /* 719 */     rollingSpin(148),
        /* 720 */     comboSmash(149),
        /* 721 */     comboFenrir(150),
        /* 722 */     comboTempest(151),
        /* 723 */     finalCharge(152),
        /* 724 */     finalBlow(154),
        /* 725 */     finalToss(155),
        /* 726 */     magicmissile(156),
        /* 727 */     lightningBolt(157),
        /* 728 */     dragonBreathe(158),
        /* 729 */     breathe_prepare(159),
        /* 730 */     dragonIceBreathe(160),
        /* 731 */     icebreathe_prepare(161),
        /* 732 */     blaze(162),
        /* 733 */     fireCircle(163),
        /* 734 */     illusion(164),
        /* 735 */     magicFlare(165),
        /* 736 */     elementalReset(166),
        /* 737 */     magicRegistance(167),
        /* 738 */     magicBooster(168),
        /* 739 */     magicShield(169),
        /* 740 */     recoveryAura(170),
        /* 741 */     flameWheel(171),
        /* 742 */     killingWing(172),
        /* 743 */     OnixBlessing(173),
        /* 744 */     Earthquake(174),
        /* 745 */     soulStone(175),
        /* 746 */     dragonThrust(176),
        /* 747 */     ghostLettering(177),
        /* 748 */     darkFog(178),
        /* 749 */     slow(179),
        /* 750 */     mapleHero(180),
        /* 751 */     Awakening(181),
        /* 752 */     flyingAssaulter(182),
        /* 753 */     tripleStab(183),
        /* 754 */     fatalBlow(184),
        /* 755 */     slashStorm1(185),
        /* 756 */     slashStorm2(186),
        /* 757 */     bloodyStorm(187),
        /* 758 */     flashBang(188),
        /* 759 */     upperStab(189),
        /* 760 */     bladeFury(190),
        /* 761 */     chainPull(192),
        /* 762 */     chainAttack(192),
        /* 763 */     owlDead(193),
        /* 764 */     monsterBombPrepare(195),
        /* 765 */     monsterBombThrow(195),
        /* 766 */     finalCut(196),
        /* 767 */     finalCutPrepare(196),
        /* 768 */     suddenRaid(198),
        /* 769 */     fly2(199),
        /* 770 */     fly2Move(200),
        /* 771 */     fly2Skill(201),
        /* 772 */     knockback(202),
        /* 773 */     rbooster_pre(206),
        /* 774 */     rbooster(206),
        /* 775 */     rbooster_after(206),
        /* 776 */     crossRoad(209),
        /* 777 */     nemesis(210),
        /* 778 */     tank(217),
        /* 779 */     tank_laser(221),
        /* 780 */     siege_pre(223),
        /* 781 */     tank_siegepre(223),
        /* 782 */     sonicBoom(226),
        /* 783 */     darkLightning(228),
        /* 784 */     darkChain(229),
        /* 785 */     cyclone_pre(0),
        /* 786 */     cyclone(0),
        /* 787 */     glacialchain(247),
        /* 788 */     flamethrower(233),
        /* 789 */     flamethrower_pre(233),
        /* 790 */     flamethrower2(234),
        /* 791 */     flamethrower_pre2(234),
        /* 792 */     gatlingshot(239),
        /* 793 */     gatlingshot2(240),
        /* 794 */     drillrush(241),
        /* 795 */     earthslug(242),
        /* 796 */     rpunch(243),
        /* 797 */     clawCut(244),
        /* 798 */     swallow(247),
        /* 799 */     swallow_attack(247),
        /* 800 */     swallow_loop(247),
        /* 801 */     flashRain(249),
        /* 802 */     OnixProtection(264),
        /* 803 */     OnixWill(265),
        /* 804 */     phantomBlow(266),
        /* 805 */     comboJudgement(267),
        /* 806 */     arrowRain(268),
        /* 807 */     arrowEruption(269),
        /* 808 */     iceStrike(270),
        /* 809 */     swingT2Giant(273),
        /* 810 */     cannonJump(295),
        /* 811 */     swiftShot(296),
        /* 812 */     giganticBackstep(298),
        /* 813 */     mistEruption(299),
        /* 814 */     cannonSmash(300),
        /* 815 */     cannonSlam(301),
        /* 816 */     flamesplash(302),
        /* 817 */     noiseWave(306),
        /* 818 */     superCannon(310),
        /* 819 */     jShot(312),
        /* 820 */     demonSlasher(313),
        /* 821 */     bombExplosion(314),
        /* 822 */     cannonSpike(315),
        /* 823 */     speedDualShot(316),
        /* 824 */     strikeDual(317),
        /* 825 */     bluntSmash(319),
        /* 826 */     crossPiercing(320),
        /* 827 */     piercing(321),
        /* 828 */     elfTornado(323),
        /* 829 */     immolation(324),
        /* 830 */     multiSniping(327),
        /* 831 */     windEffect(328),
        /* 832 */     elfrush(329),
        /* 833 */     elfrush2(329),
        /* 834 */     dealingRush(334),
        /* 835 */     maxForce0(336),
        /* 836 */     maxForce1(337),
        /* 837 */     maxForce2(338),
        /* 838 */     maxForce3(339),

        /* 840 */     iceAttack1(274),
        /* 841 */     iceAttack2(275),
        /* 842 */     iceSmash(276),
        /* 843 */     iceTempest(277),
        /* 844 */     iceChop(278),
        /* 845 */     icePanic(279),
        /* 846 */     iceDoubleJump(280),
        /* 847 */     shockwave(292),
        /* 848 */     demolition(293),
        /* 849 */     snatch(294),
        /* 850 */     windspear(295),
        /* 851 */     windshot(296);
             public final int i;


             Delay(int i) {
            /* 855 */
            this.i = i;

        }



        public static Delay fromString(String s) {
            /* 859 */
            for (Delay b : values()) {
                /* 860 */
                if (b.name().equalsIgnoreCase(s)) {
                    /* 861 */
                    return b;

                }

            }
            /* 864 */
            return null;

        }

    }


       public static class CraftingEntry
             extends Skill
             {
        /* 871 */     public final List<Triple<Integer, Integer, Integer>> targetItems = new ArrayList<>();
        /* 872 */     public final Map<Integer, Integer> reqItems = new HashMap<>();

             public boolean needOpenItem;
             public int period;
             public byte incFatigability;
             public byte reqSkillLevel;
             public byte incSkillProficiency;



        public CraftingEntry() {
        }



        public CraftingEntry(int id, byte incFatigability, byte reqSkillLevel, byte incSkillProficiency, boolean needOpenItem, int period) {
            /* 883 */
            super(id);
            /* 884 */
            this.incFatigability = incFatigability;
            /* 885 */
            this.reqSkillLevel = reqSkillLevel;
            /* 886 */
            this.incSkillProficiency = incSkillProficiency;
            /* 887 */
            this.needOpenItem = needOpenItem;
            /* 888 */
            this.period = period;

        }

    }


       public static class FamiliarEntry implements Serializable
             {
        private static final long serialVersionUID = 202106;
        /* 894 */     public final EnumSet<MonsterStatus> status = EnumSet.noneOf(MonsterStatus.class);
        public byte prop;
        public byte time;
        public byte attackCount;
        public byte targetCount;
        public byte speed;
             public Point lt;
             public Point rb;
             public boolean knockback;



        public boolean makeChanceResult() {
            /* 900 */
            return (this.prop >= 100 || Randomizer.nextInt(100) < this.prop);

        }

    }

}

